@extends('admin.layout.main')
@section('content')
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">

            <!-- Main content -->
    <section class="content">
        <!-- Small boxes (Stat box) -->
        <div class="row">
            <div class="col-lg-10 col-xs-6">
                <div class="box">

                    <div class="box-header with-border">
                        <h3 class="box-title">权限列表</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <form action="/admin/roles/{{$role->id}}/per" method="POST">
                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                            <div class="form-group">
                                            @foreach($permissions as $p) 

                                                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" name="permissions[]"
                                                                @if(in_array($p->id,$arr))
                                                                                                      checked
                                                            @endif
                                                                                                      value="{{$p->id}}">
                                            {{$p->name}}
                                        </label>
                                    </div>
                                         </label>
                                           @endforeach
                                    </div>
                                  
                                                            </div>
                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </form>


                    </div>
                </div>
            </div>
        </div>
    </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
        <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
@endsection
